package dmmm.shemes;

import java.awt.Point;
import java.util.ArrayList;

import dmmm.components.*;
import dmmm.gui.*;

public class Cpu {

    private static GuiScheme gui;

    public static GuiScheme getGui() {
        return gui;
    }

    public static void init() {
    }

    public static void connect() {
    }

    public static void gui() {
        GuiLine line; // Pomocna promenljiva
        gui = new GuiScheme("dmmm/dmmm/images/CPU.png");
        ArrayList<ArrayList<Point>> sections;
        ArrayList<Point> points;

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(132, 47));
        points.add(new Point(436, 47));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(132, 49));
        points.add(new Point(436, 49));
        sections.add(points);
        line = new GuiLine(sections, Bus1.ABUS());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(132, 85));
        points.add(new Point(436, 85));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(132, 87));
        points.add(new Point(436, 87));
        sections.add(points);
        line = new GuiLine(sections, Bus1.DBUS());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(133, 124));
        points.add(new Point(435, 124));
        sections.add(points);
        line = new GuiLine(sections, Bus1.NOTRDBUS());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(133, 143));
        points.add(new Point(435, 143));
        sections.add(points);
        line = new GuiLine(sections, Bus1.NOTWRBUS());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(134, 162));
        points.add(new Point(435, 162));
        sections.add(points);
        line = new GuiLine(sections, Bus1.NOTFCBUS());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(303, 50));
        points.add(new Point(303, 199));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(305, 50));
        points.add(new Point(305, 199));
        sections.add(points);
        line = new GuiLine(sections, Bus1.ABUS());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(331, 199));
        points.add(new Point(331, 88));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(333, 199));
        points.add(new Point(333, 88));
        sections.add(points);
        line = new GuiLine(sections, Bus1.DBUS());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(360, 199));
        points.add(new Point(360, 125));
        sections.add(points);
        line = new GuiLine(sections, Bus1.NOTRDBUS());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(379, 199));
        points.add(new Point(379, 144));
        sections.add(points);
        line = new GuiLine(sections, Bus1.NOTWRBUS());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(398, 199));
        points.add(new Point(398, 163));
        sections.add(points);
        line = new GuiLine(sections, Bus1.NOTFCBUS());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(464, 247));
        points.add(new Point(437, 247));
        sections.add(points);
        line = new GuiLine(sections, new Pin(false));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(437, 266));
        points.add(new Point(464, 266));
        sections.add(points);
        line = new GuiLine(sections, Bus1.hack());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(464, 298));
        points.add(new Point(437, 298));
        sections.add(points);
        line = new GuiLine(sections, new Pin(false));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(464, 313));
        points.add(new Point(437, 313));
        sections.add(points);
        line = new GuiLine(sections, new Pin(false));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(464, 328));
        points.add(new Point(437, 328));
        sections.add(points);
        line = new GuiLine(sections, new Pin(false));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(463, 343));
        points.add(new Point(437, 343));
        sections.add(points);
        line = new GuiLine(sections, new Pin(false));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(462, 359));
        points.add(new Point(437, 359));
        sections.add(points);
        line = new GuiLine(sections, new Pin(false));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(464, 374));
        points.add(new Point(437, 374));
        sections.add(points);
        line = new GuiLine(sections, new Pin(false));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(464, 413));
        points.add(new Point(437, 413));
        sections.add(points);
        line = new GuiLine(sections, new Pin(false));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(464, 389));
        points.add(new Point(437, 389));
        sections.add(points);
        line = new GuiLine(sections, new Pin(false));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(266, 294));
        points.add(new Point(266, 455));
        sections.add(points);
        line = new GuiLine(sections, Bus1.IBUS1());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(304, 294));
        points.add(new Point(304, 455));
        sections.add(points);
        line = new GuiLine(sections, Bus1.IBUS2());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(247, 276));
        points.add(new Point(247, 304));
        points.add(new Point(265, 304));
        sections.add(points);
        line = new GuiLine(sections, Bus1.IBUS1());
        gui.addLine(line);


        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(238, 323));
        points.add(new Point(265, 323));
        sections.add(points);
        line = new GuiLine(sections, Bus1.IBUS1());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(238, 332));
        points.add(new Point(303, 332));
        sections.add(points);
        line = new GuiLine(sections, Bus1.IBUS2());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(238, 370));
        points.add(new Point(265, 370));
        sections.add(points);
        line = new GuiLine(sections, Bus1.IBUS1());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(238, 379));
        points.add(new Point(303, 379));
        sections.add(points);
        line = new GuiLine(sections, Bus1.IBUS2());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(238, 417));
        points.add(new Point(265, 417));
        sections.add(points);
        line = new GuiLine(sections, Bus1.IBUS1());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(238, 427));
        points.add(new Point(303, 427));
        sections.add(points);
        line = new GuiLine(sections, Bus1.IBUS2());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(305, 304));
        points.add(new Point(323, 304));
        points.add(new Point(323, 276));
        sections.add(points);
        line = new GuiLine(sections, Bus1.IBUS2());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(267, 360));
        points.add(new Point(331, 360));
        sections.add(points);
        line = new GuiLine(sections, Bus1.IBUS1());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(305, 389));
        points.add(new Point(331, 389));
        sections.add(points);
        line = new GuiLine(sections, Bus1.IBUS2());
        gui.addLine(line);


        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(303, 313));
        points.add(new Point(267, 313));
        sections.add(points);
        line = new GuiLine(sections, Bus1.IBUS2());
        gui.addLine(line);


        //LABELE:
        gui.addLabel(new GuiLabel(210, 44, Bus1.ABUS()));
        gui.addLabel(new GuiLabel(210, 82, Bus1.DBUS()));
    }
}
